Leadtools Send comments on this topic. | Back to Introduction - All Topics | Help Version 15.3.5
Convert(IntPtr,Int32,Int32,Int32,RasterByteOrder,RasterByteOrder,RasterColor[],RasterColor[],Int32) Method
See Also 
Leadtools Namespace > RasterBufferConverter Class > Convert Method : Convert(IntPtr,Int32,Int32,Int32,RasterByteOrder,RasterByteOrder,RasterColor[],RasterColor[],Int32) Method




buffer
The input buffer.
width
Width in pixels of the input image data.
inBitsPerPixel
BitsPerPixel of the input image data.
outBitsPerPixel
BitsPerPixel of the desired output image data.
inOrder
The input color order.
outOrder
The output color order.
inPalette
The palette for the existing data, before conversion. If the data is converted from 16 or 24 bits per pixel, use NULL for no palette.
outPalette
The palette for the converted data. If the data is converted to 16 or 24 bits per pixel color, use NULL for no palette.
alpha
The alpha value if the destination bits per pixel contains an alpha component
Converts data in the specified unmanaged memory buffer to the specified bits per pixel and color order.

Syntax

Visual Basic (Declaration) 
Public Overloads Shared Sub Convert( _
   ByVal buffer As IntPtr, _
   ByVal width As Integer, _
   ByVal inBitsPerPixel As Integer, _
   ByVal outBitsPerPixel As Integer, _
   ByVal inOrder As RasterByteOrder, _
   ByVal outOrder As RasterByteOrder, _
   ByVal inPalette() As RasterColor, _
   ByVal outPalette() As RasterColor, _
   ByVal alpha As Integer _
) 
Visual Basic (Usage)Copy Code
Dim buffer As IntPtr
Dim width As Integer
Dim inBitsPerPixel As Integer
Dim outBitsPerPixel As Integer
Dim inOrder As RasterByteOrder
Dim outOrder As RasterByteOrder
Dim inPalette() As RasterColor
Dim outPalette() As RasterColor
Dim alpha As Integer
 
RasterBufferConverter.Convert(buffer, width, inBitsPerPixel, outBitsPerPixel, inOrder, outOrder, inPalette, outPalette, alpha)
C# 
public static void Convert( 
   IntPtr buffer,
   int width,
   int inBitsPerPixel,
   int outBitsPerPixel,
   RasterByteOrder inOrder,
   RasterByteOrder outOrder,
   RasterColor[] inPalette,
   RasterColor[] outPalette,
   int alpha
)
Managed Extensions for C++ 
public: static void Convert( 
   IntPtr buffer,
   int width,
   int inBitsPerPixel,
   int outBitsPerPixel,
   RasterByteOrder inOrder,
   RasterByteOrder outOrder,
   RasterColor[]* inPalette,
   RasterColor[]* outPalette,
   int alpha
) 
C++/CLI 
public:
static void Convert( 
   IntPtr buffer,
   int width,
   int inBitsPerPixel,
   int outBitsPerPixel,
   RasterByteOrder inOrder,
   RasterByteOrder outOrder,
   array<RasterColor>^ inPalette,
   array<RasterColor>^ outPalette,
   int alpha
) 

Parameters

buffer
The input buffer.
width
Width in pixels of the input image data.
inBitsPerPixel
BitsPerPixel of the input image data.
outBitsPerPixel
BitsPerPixel of the desired output image data.
inOrder
The input color order.
outOrder
The output color order.
inPalette
The palette for the existing data, before conversion. If the data is converted from 16 or 24 bits per pixel, use NULL for no palette.
outPalette
The palette for the converted data. If the data is converted to 16 or 24 bits per pixel color, use NULL for no palette.
alpha
The alpha value if the destination bits per pixel contains an alpha component

Example

Remarks

The conversion uses only one buffer, which must be large enough to hold the data before and after conversion.

Image data that is 8 bits per pixel or less must use a palette, and this method can use such data as input, output, or both. Therefore, you may need to specify the palette for the input, or for the output, or both.

If either inBitsPerPixel or outBitsPerPixel is 16, flags is used to determine whether the data should be treated as color or grayscale.

For more information, refer to Processing an Image.

Requirements

Target Platforms: Microsoft .NET Framework 2.0, Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also